<!DOCTYPE HTML>
<html>
<head>
<#include "/adminPage/common.html"/>
<style type="text/css">
</style>
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">

		<#include "/adminPage/header.html"/>
		<#include "/adminPage/menu.html"/>

		<div class="layui-body">
			<!-- 内容主体区域 -->
			<div style="padding: 15px">
				<fieldset class="layui-elem-field layui-field-title">
					<legend>用户管理</legend>
				</fieldset>

				<form action="${ctx}/adminPage/user" id="searchForm" method="post" >
					<div class="layui-form search">
						<button type="button" class="layui-btn layui-btn-normal" onclick="add()">添加用户</button>

						<div class="layui-inline">
							<label class="layui-form-label">登录名</label>
						</div>
						<div class="layui-inline">
							<input type="text" name="keywords" class="layui-input" value="${keywords}">
						</div>
						
						<div class="layui-inline">
							<button type="button" class="layui-btn" onclick="search()">搜索</button>
						</div>
					</div>

				

					<input type="hidden" name="pageNum" value="${page.pageNum}">
	
			</form>

			<table class="layui-table">
				<thead>
					<tr>
						<th>登录名</th>
						<th>姓名</th>
						<th>类型</th>
						<th>权限</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<#list page.records as userResp>
					<tr>
						<td>${userResp.name}</td>
						<td>${userResp.trueName}</td>
						
						<td>	
							${userResp.typeName}
						</td>
						<td>	
							<#if userResp.permission == 0>
								普通用户
							</#if>
							<#if userResp.permission == 1>
								管理员
							</#if>
						</td>
						<td>
						
							<#if userResp.status == 0>
								<span class="green">正常</span>
							</#if>
							<#if userResp.status == 1>
								<span class="red">禁用</span>
							</#if>
						</td>
						<td>
							<div class="layui-inline">
							<button class="layui-btn layui-btn-sm" onclick="edit('${userResp.id}')">编辑</button>
							</div>
							<div class="layui-inline">
							<button class="layui-btn layui-btn-danger layui-btn-sm" onclick="del('${userResp.id}')">删除</button>
							</div>
						</td>
					</tr>
					</#list>
				</tbody>
			</table>

			<div id="pageInfo"></div>
		</div>
	</div>
	</div>

	<div style="height: 0px; width: 0px; overflow: hidden;">
		<!-- 弹出框 -->
		<div class="layui-form" id="windowDiv" style="padding: 15px; display: none">
			<form id="addForm">
				<input type="hidden" name="id" id="id">
					
				<div class="layui-form-item">
					<label class="layui-form-label">登录名<span class="red">*</span></label>
					<div class="layui-input-block">
						<input type="text" name="name" id="name" class="layui-input">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">姓名<span class="red">*</span></label>
					<div class="layui-input-block">
						<input type="text" name="trueName" id="trueName" class="layui-input">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">密码<span class="red">*</span></label>
					<div class="layui-input-block">
						<input type="password" name="pass" id="pass" class="layui-input">
					</div>
				</div>
				

				<div class="layui-form-item">
					<label class="layui-form-label">类型</label>
					<div class="layui-input-block">
						<select name="type" id="type">
							<option value="0" >产品</option>
							<option value="1" >开发</option>
							<option value="2" >测试</option>
						</select>
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">权限</label>
					<div class="layui-input-block">
						<select name="permission" id="permission">
							<option value="0" >普通用户</option>
							<option value="1" >管理员</option>
						</select>
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">状态</label>
					<div class="layui-input-block">
						<select name="status" id="status">
							<option value="0" >正常</option>
							<option value="1" >禁用</option>
						</select>
					</div>
				</div>

				<div class="layui-form-item center">
					<button type="button" class="layui-btn layui-btn-normal" onclick="addOver()">提交</button>
					<button type="button" class="layui-btn" onclick="layer.closeAll()">关闭</button>
				</div>
			</form>
		</div>

	</div>

	<script src="${ctx}/js/adminPage/user/index.js?v=${jsrandom}" type="text/javascript"></script>
</body>


</html>